public class ComputeFact
{
   /**
      A method to compute n factorial (n!) recursively
      @param n a number >= 0
      @return the value of n!
   */
   public static int factorial(int n)
   {
      int sum = 1;
      if(n == 0)
         return 1;
      else if(n == 1)
      {
         return 1;
      }
      else
      {
          sum = n * factorial(n - 1);
          return sum;
      }
   }
}